module.exports = {
  provinces() {
    let promiseEvent
    let failEvent
    wx.request({
      method: 'post',
      url: wx.envConfig.host + '/user/getRegion',
      success: (res) => {
        if (res.data.error_code == "Y10000") {
          this.data = res.data.datas
          var provinces = res.data.datas.children[0].children
          promiseEvent(res.data.datas)
        } else {
          failEvent(res.data)
        }
      },
      fail: function (res) {
        failEvent(res)
      },
    })
    return new Promise((resolve, reject) => {
      promiseEvent = resolve
      failEvent = reject
    })
  },
}